package org.topteam.domain.demo;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.topteam.controller.JsonDateTimeSerializer;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;

@Entity
@Table(name = "todo")
public class Todo implements Serializable {

	private static final long serialVersionUID = 5745617294631081108L;

	@Id
	@Column(name = "todoId", length = 50)
	private String todoId;

	@Column(name = "title", length = 200)
	private String title;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "doneDate")
	@JsonSerialize(using = JsonDateTimeSerializer.class)
	private Date doneDate;

	@Column(name = "done")
	private boolean done;

	public String getTodoId() {
		return todoId;
	}

	public void setTodoId(String todoId) {
		this.todoId = todoId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getDoneDate() {
		return doneDate;
	}

	public void setDoneDate(Date doneDate) {
		this.doneDate = doneDate;
	}

	public boolean isDone() {
		return done;
	}

	public void setDone(boolean done) {
		this.done = done;
	}

}
